.class Lcom/qiniu/utils/InputStreamAt$1;
.super Lorg/apache/http/entity/AbstractHttpEntity;
.source "InputStreamAt.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/qiniu/utils/InputStreamAt;->toHttpEntity(JILcom/qiniu/auth/Client$ClientExecutor;)Lorg/apache/http/HttpEntity;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/qiniu/utils/InputStreamAt;

.field final synthetic val$client:Lcom/qiniu/auth/Client$ClientExecutor;

.field final synthetic val$input:Lcom/qiniu/utils/InputStreamAt;

.field final synthetic val$length:I

.field final synthetic val$offset:J


# direct methods
.method constructor <init>(Lcom/qiniu/utils/InputStreamAt;IJLcom/qiniu/utils/InputStreamAt;Lcom/qiniu/auth/Client$ClientExecutor;)V
    .registers 8
    .param p1, "this$0"    # Lcom/qiniu/utils/InputStreamAt;

    .prologue
    .line 186
    iput-object p1, p0, Lcom/qiniu/utils/InputStreamAt$1;->this$0:Lcom/qiniu/utils/InputStreamAt;

    iput p2, p0, Lcom/qiniu/utils/InputStreamAt$1;->val$length:I

    iput-wide p3, p0, Lcom/qiniu/utils/InputStreamAt$1;->val$offset:J

    iput-object p5, p0, Lcom/qiniu/utils/InputStreamAt$1;->val$input:Lcom/qiniu/utils/InputStreamAt;

    iput-object p6, p0, Lcom/qiniu/utils/InputStreamAt$1;->val$client:Lcom/qiniu/auth/Client$ClientExecutor;

    invoke-direct {p0}, Lorg/apache/http/entity/AbstractHttpEntity;-><init>()V

    return-void
.end method


# virtual methods
.method public getContent()Ljava/io/InputStream;
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Ljava/lang/IllegalStateException;
        }
    .end annotation

    .prologue
    .line 199
    const/4 v0, 0x0

    return-object v0
.end method

.method public getContentLength()J
    .registers 3

    .prologue
    .line 194
    iget v0, p0, Lcom/qiniu/utils/InputStreamAt$1;->val$length:I

    int-to-long v0, v0

    return-wide v0
.end method

.method public isRepeatable()Z
    .registers 2

    .prologue
    .line 189
    const/4 v0, 0x0

    return v0
.end method

.method public isStreaming()Z
    .registers 2

    .prologue
    .line 226
    const/4 v0, 0x0

    return v0
.end method

.method public writeTo(Ljava/io/OutputStream;)V
    .registers 20
    .param p1, "outputStream"    # Ljava/io/OutputStream;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 204
    const/high16 v2, 0x10000

    .line 205
    .local v2, "blockSize":I
    move-object/from16 v0, p0

    iget-wide v10, v0, Lcom/qiniu/utils/InputStreamAt$1;->val$offset:J

    .line 206
    .local v10, "start":J
    const-wide/16 v6, 0x0

    .line 207
    .local v6, "initStart":J
    move-object/from16 v0, p0

    iget-wide v14, v0, Lcom/qiniu/utils/InputStreamAt$1;->val$offset:J

    move-object/from16 v0, p0

    iget v9, v0, Lcom/qiniu/utils/InputStreamAt$1;->val$length:I

    int-to-long v0, v9

    move-wide/from16 v16, v0

    add-long v4, v14, v16

    .line 208
    .local v4, "end":J
    sub-long v12, v4, v10

    .line 209
    .local v12, "total":J
    :goto_17
    cmp-long v9, v10, v4

    if-gez v9, :cond_28

    .line 210
    move-object/from16 v0, p0

    iget-object v9, v0, Lcom/qiniu/utils/InputStreamAt$1;->this$0:Lcom/qiniu/utils/InputStreamAt;

    # getter for: Lcom/qiniu/utils/InputStreamAt;->mClosed:Z
    invoke-static {v9}, Lcom/qiniu/utils/InputStreamAt;->access$000(Lcom/qiniu/utils/InputStreamAt;)Z

    move-result v9

    if-eqz v9, :cond_29

    .line 211
    invoke-virtual/range {p1 .. p1}, Ljava/io/OutputStream;->close()V

    .line 222
    :cond_28
    return-void

    .line 214
    :cond_29
    int-to-long v14, v2

    sub-long v16, v4, v10

    invoke-static/range {v14 .. v17}, Ljava/lang/StrictMath;->min(JJ)J

    move-result-wide v14

    long-to-int v8, v14

    .line 215
    .local v8, "readLength":I
    move-object/from16 v0, p0

    iget-object v9, v0, Lcom/qiniu/utils/InputStreamAt$1;->val$input:Lcom/qiniu/utils/InputStreamAt;

    invoke-virtual {v9, v10, v11, v8}, Lcom/qiniu/utils/InputStreamAt;->read(JI)[B

    move-result-object v3

    .line 216
    .local v3, "data":[B
    move-object/from16 v0, p1

    invoke-virtual {v0, v3}, Ljava/io/OutputStream;->write([B)V

    .line 217
    invoke-virtual/range {p1 .. p1}, Ljava/io/OutputStream;->flush()V

    .line 218
    int-to-long v14, v8

    add-long/2addr v6, v14

    .line 219
    move-object/from16 v0, p0

    iget-object v9, v0, Lcom/qiniu/utils/InputStreamAt$1;->val$client:Lcom/qiniu/auth/Client$ClientExecutor;

    invoke-virtual {v9, v6, v7, v12, v13}, Lcom/qiniu/auth/Client$ClientExecutor;->upload(JJ)V

    .line 220
    int-to-long v14, v8

    add-long/2addr v10, v14

    .line 221
    goto :goto_17
.end method
